﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SaleOnlineSystem.Controls
{
    public partial class CartLeft : System.Web.UI.UserControl
    {
        public string flag="hidden";
        protected void Page_Load(object sender, EventArgs e)
        {
            if(Session["Username"] != null){
                if (!Page.IsPostBack)
                {
                    txtFullname.Text = Session["Employee_FullName"].ToString();
                    txtAddress.Text = Session["Employee_Address"].ToString();
                    txtPhone.Text = Session["Employee_Phonenumber"].ToString();
                    txtEmail.Text = Session["Employee_Email"].ToString();
                    BOL.Shopping.ShoppingCart.Instance.customer.fullname = txtFullname.Text;
                    BOL.Shopping.ShoppingCart.Instance.customer.address = txtAddress.Text;
                    BOL.Shopping.ShoppingCart.Instance.customer.email = txtEmail.Text;
                    BOL.Shopping.ShoppingCart.Instance.customer.phonenumber = txtPhone.Text;
                }
            }                      
        }

        protected void lbtEdit_Click(object sender, EventArgs e)
        {

            flag = "";
        }

        protected void btnContinue_Click(object sender, EventArgs e)
        {
            flag = "hidden";
            BOL.Shopping.ShoppingCart.Instance.customer.fullname = txtFullname.Text;
            BOL.Shopping.ShoppingCart.Instance.customer.address = txtAddress.Text;
            BOL.Shopping.ShoppingCart.Instance.customer.email = txtEmail.Text;
            BOL.Shopping.ShoppingCart.Instance.customer.phonenumber = txtPhone.Text;
            Response.Redirect("~/phuongthucthanhtoan.htm");
        }
    }
}